﻿using iemtm.WeChat.Core.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iemtm.WeChat.Core.Managers
{
    public interface IGeneratorManager
    {
        /// <summary>
        /// 获取发电瞬态记录
        /// </summary>
        /// <param name="rptType">类型</param>
        /// <param name="dtuId">dtuid</param>
        /// <param name="startTime">开始时间</param>
        /// <param name="endTime">结束时间</param>
        /// <returns></returns>
        Task<ReportRecord> GetReportRecordFirstAsync(int rptType,string dtuId,DateTime startTime,DateTime endTime);

        /// <summary>
        /// 添加采集器
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<Collector> AddCollectorAsync(Collector input);

        /// <summary>
        /// 修改采集器
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
          Task<Collector> UpdateCollectorAsync(Collector input);
        
            /// <summary>
            /// 添加油机
            /// </summary>
            /// <param name="input"></param>
            /// <returns></returns>
            Task<Generator> AddGeneratorAsync(Generator input);

        /// <summary>
        /// 机组Code的生成
        /// </summary>
        /// <returns></returns>
        string MakeGeneratorCode(string PrjCode);

        /// <summary>
        /// 模块自检
        /// </summary>
        /// <param name="dtuId"></param>
        /// <param name="prjcode">登录人prjcode</param>
        /// <returns></returns>
        Task<SelfCheckInfo> GetSelfCheckInfoByDtuId(string dtuId, string prjcode);

        #region 采集器 保养-与图片
        /// <summary>
        /// 获取采集器保养信息和图片
        /// </summary>
        /// <param name="MaintId">id</param>
        /// <returns></returns>
        Task<MaintenenceDetailedModel> GetGenMainAndPritureAsync(int MaintId);

        /// <summary>
        /// 获取保养运行时长
        /// </summary>
        /// <returns></returns>
         Task<double> GetGenMainRunTimeAsync(string GensetNum, string PrjCode);

        /// <summary>
        /// 判断油机保养是否有一条没有审核的
        /// </summary>
        /// <param name="GensetNum"></param>
        /// <returns></returns>
         Task<bool> GetGenMainIsAuditedAnyAsync(string GensetNum);

        /// <summary>
        /// 添加采集器保养记录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
         Task<Maintenence> AddMaintenenceAsync(Maintenence input);

      

        #endregion

        #region 采集器维修-与图片
        /// <summary>
        /// 获取采集器维修信息和图片
        /// </summary>
        /// <param name="Code">Code</param>
        /// <returns></returns>
        Task<CollectorRepairDetailedModel> GetCollectorRepairAndPritureAsync(string Code);
        /// <summary>
        /// 该采集器存在未审核或未维修的工单
        /// </summary>
        /// <param name="DTUID"></param>
        /// <returns></returns>
        Task<bool> GetMaintainAnyAsync(string DTUID);

        /// <summary>
        /// 获取维修数据list
        /// </summary>
        /// <param name="DTUID"></param>
        /// <param name="AuditState"></param>
        /// <returns></returns>
        Task<List<CollectorRepair>> GetMaintainListAsync(string DTUID, int AuditState=-1);

        /// <summary>
        /// 获取维修数据list
        /// </summary>
        /// <param name="DTUID"></param>
        /// <param name="CreateTime">大于创建时间的</param>
        /// <returns></returns>
        Task<List<CollectorRepair>> GetMaintainByCreateTimeListAsync(string DTUID, DateTime CreateTime);

     

        /// <summary>
        /// 添加采集器维修记录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
       Task<CollectorRepair> AddMaintainAsync(CollectorRepair input);
      
        /// <summary>
        /// 添加采集器图片维修记录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<CollectorRepairPicture> AddMaintainPictureAsync(CollectorRepairPicture input);
      

        /// <summary>
        /// 生成维修工单
        /// </summary>
        /// <returns></returns>
        string GetRepairCode();
        #endregion

        #region 支架
        /// <summary>
        /// 查询支架
        /// </summary>
        /// <param name="DTUID">油机DTUID</param>
        /// <param name="AuditState">支架审核状态</param>
        /// <returns></returns>
        Task<List<CollectorBracket>> GetCollectorBracketAsync(string DTUID, int AuditState);

        /// <summary>
        /// 统计同个机组支架申请的数量
        /// </summary>
        /// <param name="DTUID"></param>
        /// <returns></returns>
        Task<int> GetCollectorBracketCountAsync(string DTUID);

        /// <summary>
        /// 添加支架
        /// </summary>
        /// <param name="cb"></param>
        /// <returns></returns>
        Task<CollectorBracket> AddCollectorBracketAsync(CollectorBracket cb);

        /// <summary>
        /// 添加支架图片
        /// </summary>
        /// <param name="cb"></param>
        /// <returns></returns>
        Task<CollectorBracketPicture> AddCollectorBracketPictureAsync(CollectorBracketPicture cb);

        /// <summary>
        /// 获取支架信息和图片
        /// </summary>
        /// <param name="BracketCode">支架Code</param>
        /// <returns></returns>
        Task<CollectorBracketDetailedModel> GetCollectorBracketAndPritureAsync(string BracketCode);

        /// <summary>
        /// 生成支架工单
        /// </summary>
        /// <returns></returns>
        string GetBracketCode();
        #endregion




    }
}
